3.480 \(\int \frac{\tan ^3(c+d x)}{(a+b \tan (c+d x))^3} \, dx\)

Optimal. Leaf size=149 \[ -\frac{a^2 \left (a^2+5 b^2\right )}{2 b^2 d \left (a^2+b^2\right )^2 (a+b \tan (c+d x))}-\frac{a^2 \tan (c+d x)}{2 b d \left (a^2+b^2\right ) (a+b \tan (c+d x))^2}+\frac{a \left (a^2-3 b^2\right ) \log (a \cos (c+d x)+b \sin (c+d x))}{d \left (a^2+b^2\right )^3}-\frac{b x \left (3 a^2-b^2\right )}{\left (a^2+b^2\right )^3} \]

[Out]

-((b*(3*a^2 - b^2)*x)/(a^2 + b^2)^3) + (a*(a^2 - 3*b^2)*Log[a*Cos[c + d*x] + b*Sin[c + d*x]])/((a^2 + b^2)^3*d
) - (a^2*Tan[c + d*x])/(2*b*(a^2 + b^2)*d*(a + b*Tan[c + d*x])^2) - (a^2*(a^2 + 5*b^2))/(2*b^2*(a^2 + b^2)^2*d
*(a + b*Tan[c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.227382, antiderivative size = 149, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {3565, 3628, 3531, 3530} \[ -\frac{a^2 \left (a^2+5 b^2\right )}{2 b^2 d \left (a^2+b^2\right )^2 (a+b \tan (c+d x))}-\frac{a^2 \tan (c+d x)}{2 b d \left (a^2+b^2\right ) (a+b \tan (c+d x))^2}+\frac{a \left (a^2-3 b^2\right ) \log (a \cos (c+d x)+b \sin (c+d x))}{d \left (a^2+b^2\right )^3}-\frac{b x \left (3 a^2-b^2\right )}{\left (a^2+b^2\right )^3} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^3/(a + b*Tan[c + d*x])^3,x]

[Out]

-((b*(3*a^2 - b^2)*x)/(a^2 + b^2)^3) + (a*(a^2 - 3*b^2)*Log[a*Cos[c + d*x] + b*Sin[c + d*x]])/((a^2 + b^2)^3*d
) - (a^2*Tan[c + d*x])/(2*b*(a^2 + b^2)*d*(a + b*Tan[c + d*x])^2) - (a^2*(a^2 + 5*b^2))/(2*b^2*(a^2 + b^2)^2*d
*(a + b*Tan[c + d*x]))

Rule 3565

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Si
mp[((b*c - a*d)^2*(a + b*Tan[e + f*x])^(m - 2)*(c + d*Tan[e + f*x])^(n + 1))/(d*f*(n + 1)*(c^2 + d^2)), x] - D
ist[1/(d*(n + 1)*(c^2 + d^2)), Int[(a + b*Tan[e + f*x])^(m - 3)*(c + d*Tan[e + f*x])^(n + 1)*Simp[a^2*d*(b*d*(
m - 2) - a*c*(n + 1)) + b*(b*c - 2*a*d)*(b*c*(m - 2) + a*d*(n + 1)) - d*(n + 1)*(3*a^2*b*c - b^3*c - a^3*d + 3
*a*b^2*d)*Tan[e + f*x] - b*(a*d*(2*b*c - a*d)*(m + n - 1) - b^2*(c^2*(m - 2) - d^2*(n + 1)))*Tan[e + f*x]^2, x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && Gt
Q[m, 2] && LtQ[n, -1] && IntegerQ[2*m]

Rule 3628

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f
_.)*(x_)]^2), x_Symbol] :> Simp[((A*b^2 - a*b*B + a^2*C)*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)*(a^2 + b^2
)), x] + Dist[1/(a^2 + b^2), Int[(a + b*Tan[e + f*x])^(m + 1)*Simp[b*B + a*(A - C) - (A*b - a*B - b*C)*Tan[e +
 f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0] && LtQ[m, -1] && NeQ[a^2
 + b^2, 0]

Rule 3531

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((a*c +
 b*d)*x)/(a^2 + b^2), x] + Dist[(b*c - a*d)/(a^2 + b^2), Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x]
 /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[a*c + b*d, 0]

Rule 3530

Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c*Log[Re
moveContent[a*Cos[e + f*x] + b*Sin[e + f*x], x]])/(b*f), x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d,
0] && NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]

Rubi steps

\begin{align*} \int \frac{\tan ^3(c+d x)}{(a+b \tan (c+d x))^3} \, dx &=-\frac{a^2 \tan (c+d x)}{2 b \left (a^2+b^2\right ) d (a+b \tan (c+d x))^2}+\frac{\int \frac{a^2-2 a b \tan (c+d x)+\left (a^2+2 b^2\right ) \tan ^2(c+d x)}{(a+b \tan (c+d x))^2} \, dx}{2 b \left (a^2+b^2\right )}\\ &=-\frac{a^2 \tan (c+d x)}{2 b \left (a^2+b^2\right ) d (a+b \tan (c+d x))^2}-\frac{a^2 \left (a^2+5 b^2\right )}{2 b^2 \left (a^2+b^2\right )^2 d (a+b \tan (c+d x))}+\frac{\int \frac{-4 a b^2-2 b \left (a^2-b^2\right ) \tan (c+d x)}{a+b \tan (c+d x)} \, dx}{2 b \left (a^2+b^2\right )^2}\\ &=-\frac{b \left (3 a^2-b^2\right ) x}{\left (a^2+b^2\right )^3}-\frac{a^2 \tan (c+d x)}{2 b \left (a^2+b^2\right ) d (a+b \tan (c+d x))^2}-\frac{a^2 \left (a^2+5 b^2\right )}{2 b^2 \left (a^2+b^2\right )^2 d (a+b \tan (c+d x))}+\frac{\left (a \left (a^2-3 b^2\right )\right ) \int \frac{b-a \tan (c+d x)}{a+b \tan (c+d x)} \, dx}{\left (a^2+b^2\right )^3}\\ &=-\frac{b \left (3 a^2-b^2\right ) x}{\left (a^2+b^2\right )^3}+\frac{a \left (a^2-3 b^2\right ) \log (a \cos (c+d x)+b \sin (c+d x))}{\left (a^2+b^2\right )^3 d}-\frac{a^2 \tan (c+d x)}{2 b \left (a^2+b^2\right ) d (a+b \tan (c+d x))^2}-\frac{a^2 \left (a^2+5 b^2\right )}{2 b^2 \left (a^2+b^2\right )^2 d (a+b \tan (c+d x))}\\ \end{align*}

Mathematica [C]  time = 4.81751, size = 269, normalized size = 1.81 \[ \frac{\frac{2 b}{\left (a^2+b^2\right ) (a+b \tan (c+d x))}-\frac{4 a b \log (a+b \tan (c+d x))}{\left (a^2+b^2\right )^2}-\frac{a b \left (\frac{\left (a^2+b^2\right ) \left (5 a^2+4 a b \tan (c+d x)+b^2\right )}{(a+b \tan (c+d x))^2}+\left (2 b^2-6 a^2\right ) \log (a+b \tan (c+d x))\right )}{\left (a^2+b^2\right )^3}-\frac{a}{b (a+b \tan (c+d x))^2}-\frac{2 \tan (c+d x)}{(a+b \tan (c+d x))^2}+\frac{a \log (-\tan (c+d x)+i)}{(b-i a)^3}+\frac{a \log (\tan (c+d x)+i)}{(b+i a)^3}+\frac{i \log (-\tan (c+d x)+i)}{(a+i b)^2}-\frac{i \log (\tan (c+d x)+i)}{(a-i b)^2}}{2 b d} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^3/(a + b*Tan[c + d*x])^3,x]

[Out]

((I*Log[I - Tan[c + d*x]])/(a + I*b)^2 + (a*Log[I - Tan[c + d*x]])/((-I)*a + b)^3 - (I*Log[I + Tan[c + d*x]])/
(a - I*b)^2 + (a*Log[I + Tan[c + d*x]])/(I*a + b)^3 - (4*a*b*Log[a + b*Tan[c + d*x]])/(a^2 + b^2)^2 - a/(b*(a
+ b*Tan[c + d*x])^2) - (2*Tan[c + d*x])/(a + b*Tan[c + d*x])^2 + (2*b)/((a^2 + b^2)*(a + b*Tan[c + d*x])) - (a
*b*((-6*a^2 + 2*b^2)*Log[a + b*Tan[c + d*x]] + ((a^2 + b^2)*(5*a^2 + b^2 + 4*a*b*Tan[c + d*x]))/(a + b*Tan[c +
 d*x])^2))/(a^2 + b^2)^3)/(2*b*d)

________________________________________________________________________________________

Maple [A]  time = 0.03, size = 256, normalized size = 1.7 \begin{align*} -{\frac{\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ){a}^{3}}{2\,d \left ({a}^{2}+{b}^{2} \right ) ^{3}}}+{\frac{3\,\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) a{b}^{2}}{2\,d \left ({a}^{2}+{b}^{2} \right ) ^{3}}}-3\,{\frac{\arctan \left ( \tan \left ( dx+c \right ) \right ){a}^{2}b}{d \left ({a}^{2}+{b}^{2} \right ) ^{3}}}+{\frac{\arctan \left ( \tan \left ( dx+c \right ) \right ){b}^{3}}{d \left ({a}^{2}+{b}^{2} \right ) ^{3}}}+{\frac{{a}^{3}\ln \left ( a+b\tan \left ( dx+c \right ) \right ) }{d \left ({a}^{2}+{b}^{2} \right ) ^{3}}}-3\,{\frac{a\ln \left ( a+b\tan \left ( dx+c \right ) \right ){b}^{2}}{d \left ({a}^{2}+{b}^{2} \right ) ^{3}}}-{\frac{{a}^{4}}{{b}^{2}d \left ({a}^{2}+{b}^{2} \right ) ^{2} \left ( a+b\tan \left ( dx+c \right ) \right ) }}-3\,{\frac{{a}^{2}}{d \left ({a}^{2}+{b}^{2} \right ) ^{2} \left ( a+b\tan \left ( dx+c \right ) \right ) }}+{\frac{{a}^{3}}{2\,{b}^{2}d \left ({a}^{2}+{b}^{2} \right ) \left ( a+b\tan \left ( dx+c \right ) \right ) ^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^3/(a+b*tan(d*x+c))^3,x)

[Out]

-1/2/d/(a^2+b^2)^3*ln(1+tan(d*x+c)^2)*a^3+3/2/d/(a^2+b^2)^3*ln(1+tan(d*x+c)^2)*a*b^2-3/d/(a^2+b^2)^3*arctan(ta
n(d*x+c))*a^2*b+1/d/(a^2+b^2)^3*arctan(tan(d*x+c))*b^3+1/d*a^3/(a^2+b^2)^3*ln(a+b*tan(d*x+c))-3/d*a/(a^2+b^2)^
3*ln(a+b*tan(d*x+c))*b^2-1/d/b^2*a^4/(a^2+b^2)^2/(a+b*tan(d*x+c))-3/d*a^2/(a^2+b^2)^2/(a+b*tan(d*x+c))+1/2/d*a
^3/b^2/(a^2+b^2)/(a+b*tan(d*x+c))^2

________________________________________________________________________________________

Maxima [A]  time = 1.56094, size = 354, normalized size = 2.38 \begin{align*} -\frac{\frac{2 \,{\left (3 \, a^{2} b - b^{3}\right )}{\left (d x + c\right )}}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} - \frac{2 \,{\left (a^{3} - 3 \, a b^{2}\right )} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} + \frac{{\left (a^{3} - 3 \, a b^{2}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} + \frac{a^{5} + 5 \, a^{3} b^{2} + 2 \,{\left (a^{4} b + 3 \, a^{2} b^{3}\right )} \tan \left (d x + c\right )}{a^{6} b^{2} + 2 \, a^{4} b^{4} + a^{2} b^{6} +{\left (a^{4} b^{4} + 2 \, a^{2} b^{6} + b^{8}\right )} \tan \left (d x + c\right )^{2} + 2 \,{\left (a^{5} b^{3} + 2 \, a^{3} b^{5} + a b^{7}\right )} \tan \left (d x + c\right )}}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+b*tan(d*x+c))^3,x, algorithm="maxima")

[Out]

-1/2*(2*(3*a^2*b - b^3)*(d*x + c)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) - 2*(a^3 - 3*a*b^2)*log(b*tan(d*x + c) +
 a)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) + (a^3 - 3*a*b^2)*log(tan(d*x + c)^2 + 1)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4
 + b^6) + (a^5 + 5*a^3*b^2 + 2*(a^4*b + 3*a^2*b^3)*tan(d*x + c))/(a^6*b^2 + 2*a^4*b^4 + a^2*b^6 + (a^4*b^4 + 2
*a^2*b^6 + b^8)*tan(d*x + c)^2 + 2*(a^5*b^3 + 2*a^3*b^5 + a*b^7)*tan(d*x + c)))/d

________________________________________________________________________________________

Fricas [B]  time = 1.80536, size = 687, normalized size = 4.61 \begin{align*} \frac{a^{5} - 5 \, a^{3} b^{2} - 2 \,{\left (3 \, a^{4} b - a^{2} b^{3}\right )} d x +{\left (a^{5} + 7 \, a^{3} b^{2} - 2 \,{\left (3 \, a^{2} b^{3} - b^{5}\right )} d x\right )} \tan \left (d x + c\right )^{2} +{\left (a^{5} - 3 \, a^{3} b^{2} +{\left (a^{3} b^{2} - 3 \, a b^{4}\right )} \tan \left (d x + c\right )^{2} + 2 \,{\left (a^{4} b - 3 \, a^{2} b^{3}\right )} \tan \left (d x + c\right )\right )} \log \left (\frac{b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) + a^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) + 2 \,{\left (3 \, a^{4} b - 3 \, a^{2} b^{3} - 2 \,{\left (3 \, a^{3} b^{2} - a b^{4}\right )} d x\right )} \tan \left (d x + c\right )}{2 \,{\left ({\left (a^{6} b^{2} + 3 \, a^{4} b^{4} + 3 \, a^{2} b^{6} + b^{8}\right )} d \tan \left (d x + c\right )^{2} + 2 \,{\left (a^{7} b + 3 \, a^{5} b^{3} + 3 \, a^{3} b^{5} + a b^{7}\right )} d \tan \left (d x + c\right ) +{\left (a^{8} + 3 \, a^{6} b^{2} + 3 \, a^{4} b^{4} + a^{2} b^{6}\right )} d\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+b*tan(d*x+c))^3,x, algorithm="fricas")

[Out]

1/2*(a^5 - 5*a^3*b^2 - 2*(3*a^4*b - a^2*b^3)*d*x + (a^5 + 7*a^3*b^2 - 2*(3*a^2*b^3 - b^5)*d*x)*tan(d*x + c)^2
+ (a^5 - 3*a^3*b^2 + (a^3*b^2 - 3*a*b^4)*tan(d*x + c)^2 + 2*(a^4*b - 3*a^2*b^3)*tan(d*x + c))*log((b^2*tan(d*x
 + c)^2 + 2*a*b*tan(d*x + c) + a^2)/(tan(d*x + c)^2 + 1)) + 2*(3*a^4*b - 3*a^2*b^3 - 2*(3*a^3*b^2 - a*b^4)*d*x
)*tan(d*x + c))/((a^6*b^2 + 3*a^4*b^4 + 3*a^2*b^6 + b^8)*d*tan(d*x + c)^2 + 2*(a^7*b + 3*a^5*b^3 + 3*a^3*b^5 +
 a*b^7)*d*tan(d*x + c) + (a^8 + 3*a^6*b^2 + 3*a^4*b^4 + a^2*b^6)*d)

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**3/(a+b*tan(d*x+c))**3,x)

[Out]

Exception raised: AttributeError

________________________________________________________________________________________

Giac [A]  time = 1.87222, size = 381, normalized size = 2.56 \begin{align*} -\frac{\frac{2 \,{\left (3 \, a^{2} b - b^{3}\right )}{\left (d x + c\right )}}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} + \frac{{\left (a^{3} - 3 \, a b^{2}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} - \frac{2 \,{\left (a^{3} b - 3 \, a b^{3}\right )} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{6} b + 3 \, a^{4} b^{3} + 3 \, a^{2} b^{5} + b^{7}} + \frac{3 \, a^{3} b^{4} \tan \left (d x + c\right )^{2} - 9 \, a b^{6} \tan \left (d x + c\right )^{2} + 2 \, a^{6} b \tan \left (d x + c\right ) + 14 \, a^{4} b^{3} \tan \left (d x + c\right ) - 12 \, a^{2} b^{5} \tan \left (d x + c\right ) + a^{7} + 9 \, a^{5} b^{2} - 4 \, a^{3} b^{4}}{{\left (a^{6} b^{2} + 3 \, a^{4} b^{4} + 3 \, a^{2} b^{6} + b^{8}\right )}{\left (b \tan \left (d x + c\right ) + a\right )}^{2}}}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+b*tan(d*x+c))^3,x, algorithm="giac")

[Out]

-1/2*(2*(3*a^2*b - b^3)*(d*x + c)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) + (a^3 - 3*a*b^2)*log(tan(d*x + c)^2 + 1
)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) - 2*(a^3*b - 3*a*b^3)*log(abs(b*tan(d*x + c) + a))/(a^6*b + 3*a^4*b^3 +
3*a^2*b^5 + b^7) + (3*a^3*b^4*tan(d*x + c)^2 - 9*a*b^6*tan(d*x + c)^2 + 2*a^6*b*tan(d*x + c) + 14*a^4*b^3*tan(
d*x + c) - 12*a^2*b^5*tan(d*x + c) + a^7 + 9*a^5*b^2 - 4*a^3*b^4)/((a^6*b^2 + 3*a^4*b^4 + 3*a^2*b^6 + b^8)*(b*
tan(d*x + c) + a)^2))/d